<script setup lang="ts">
import ItemWrap from "@/components/item-wrap";
import LeftTop from "./left-top.vue";
import LeftCenter from "./left-center.vue";
import LeftBottom from "./left-bottom.vue";
import CenterMap from "./center-map.vue";
import CenterBottom from "./center-bottom.vue";
import RightTop from "./right-top.vue";
import RightCenter from "./right-center.vue";
import RightBottom from "./right-bottom.vue";
import ItemWrap2 from "@/components/item-wrap/item-wrap2.vue";
import {ref} from "vue";
const data = ref(null)
fetch("data1.json").then(res=> res.json()).then(res => {
  console.log(res,"res")
  data.value = res
})
</script>

<template>
  <div class="index-box" v-if="data">
    <div class="contetn_left">
      <div class="pagetab">
      </div>
        <LeftTop v-if="data.Title" :data="data.Data.LeftTopData" :title="data.Title.left.top" />
      <ItemWrap class="contetn_left-center contetn_lr-item" title="">
        <LeftCenter v-if="data.Title.left.center" :allValue="data.Data.allValue" :data="data.Data.LeftCenterData" :title="data.Title.left.center" />
      </ItemWrap>
      <ItemWrap
          class="contetn_left-bottom contetn_lr-item"

          style="padding: 0 10px 16px 10px;"

      >
        <LeftBottom v-if="data.Data.LeftBottomData" :userInfo="data.Data.userInfo"  :data="data.Data.LeftBottomData" :title="data.Title.left.bottom"/>
      </ItemWrap>
    </div>
    <div class="contetn_center">
      <CenterMap  :dataModal="data.Data.centerModal" :data="data.Data.centerData"  class="contetn_center_top" />
      <ItemWrap2 class="contetn_center-bottom" >
        <CenterBottom :data3="data.Data.centerBottom3" :data2="data.Data.centerBottom1" :data="data.Data.centerBottom2" />
      </ItemWrap2>
    </div>
    <div class="contetn_right">
      <ItemWrap
          class="contetn_left-bottom contetn_lr-item"
      >
        <RightTop v-if="data.Data.rightTop" :data="data.Data.rightTop" :title="data.Title.right.top" />
      </ItemWrap>
      <ItemWrap
          class="contetn_left-bottom contetn_lr-item"

          style="padding: 0 10px 16px 10px"
      >
        <RightCenter v-if="data.Data.rightCenter" :data="data.Data.rightCenter" :title="data.Title.right.center" />
      </ItemWrap>
      <ItemWrap
          class="contetn_left-bottom contetn_lr-item"

          :title="data.Title.right.bottom"
      >
        <RightBottom :data="data.Data.rightBottom" />
      </ItemWrap>
    </div>
  </div>
</template>

<style scoped lang="scss">
.index-box {
  width: 100%;
  display: flex;
  min-height: calc(100% - 64px);
  justify-content: space-between;
}
//左边 右边 结构一样
.contetn_left,
.contetn_right {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  position: relative;
  width: 420px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.contetn_center {
  flex: 1;
  width: 1020px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  .contetn_center-bottom {
    height: 315px;
  }
}

.contetn_lr-item {
  height: 310px;
}
.contents {
  .contetn_left,
  .contetn_right {

    width: 420px;
    box-sizing: border-box;
    // padding: 16px 0;
  }

  .contetn_center {
    width: 1200px;
  }

  //左右两侧 三个块
  .contetn_lr-item {
    height: 310px;
  }

  .contetn_center_top {
   width: 1020px;
  }

  // 中间
  .contetn_center {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }

  .contetn_center-bottom {
    height: 315px;
  }

  //左边 右边 结构一样
  .contetn_left,
  .contetn_right {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    position: relative;


  }
}


@keyframes rotating {
  0% {
    -webkit-transform: rotate(0) scale(1);
    transform: rotate(0) scale(1);
  }
  50% {
    -webkit-transform: rotate(180deg) scale(1.1);
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    -webkit-transform: rotate(360deg) scale(1);
    transform: rotate(360deg) scale(1);
  }
}
</style>
